﻿
using System;
using Puerts;

namespace purets_test0.Gen
{

    public static class TT_Wrap
    {


        [MonoPInvokeCallback(typeof(V8ConstructorCallback))]
        private static IntPtr Constructor(IntPtr isolate, IntPtr info, int paramLen, long data)
        {
            try
            {



                {




                    {

                        var result = new TT();




                        return Utils.GetObjectPtr((int)data, typeof(TT), result);

                    }

                }



            }
            catch (Exception e)
            {
                PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
            return IntPtr.Zero;
        }
        // ==================== constructor end ====================

        // ==================== methods start ====================

        [MonoPInvokeCallback(typeof(V8FunctionCallback))]
        private static void F_Log(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data)
        {
            try
            {



                {


                    IntPtr v8Value0 = PuertsDLL.GetArgumentValue(info, 0);
                    object argobj0 = null;
                    JsValueType argType0 = JsValueType.Invalid;



                    {

                        string arg0 = PuertsDLL.GetStringFromValue(isolate, v8Value0, false);


                        TT.Log(arg0);







                    }

                }


            }
            catch (Exception e)
            {
                PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
        }

        // ==================== methods end ====================

        // ==================== properties start ====================

        // ==================== properties end ====================
        // ==================== array item get/set start ====================


        // ==================== array item get/set end ====================
        // ==================== operator start ====================

        // ==================== operator end ====================
        // ==================== events start ====================

        // ==================== events end ====================

        public static TypeRegisterInfo GetRegisterInfo()
        {
            return new TypeRegisterInfo()
            {
                BlittableCopy = false,
                Constructor = Constructor,
                Methods = new Dictionary<MethodKey, V8FunctionCallback>()
                {
                    { new MethodKey { Name = "Log", IsStatic = true}, F_Log }
                },
                Properties = new Dictionary<string, PropertyRegisterInfo>()
                {

                },
                LazyMembers = new List<LazyMemberRegisterInfo>()
                {
                }
            };
        }

    }
}
